const model = {
  name: 'rm',
  fields: [{
    code: 'code',
    name: '编码',
    type: 'code',
    cardpos: 1
  }, {
    code: 'name',
    name: '名称',
    type: 'code',
    cardpos: 2
  }, {
    code: 'relation_code',
    name: '映射储存表',
    type: 'code',
    cardpos: 9
  }, {
    code: 'cacheable',
    name: '启用缓存',
    type: 'state',
    rangeset: '0:是@3:否',
    cardpos: 3
  }, {
    code: 'sortable',
    name: '可排序',
    type: 'stat',
    rangeset: '0:是@3:否',
    cardpos: 4
  }, {
    code: 'subject_id',
    name: '主体数据集',
    type: 'ref',
    cardpos: 5,
    rangeset: {
      path: '/service/{app}/bill/data/dataset/list'
    }
  }, {
    code: 'subject_tpl',
    name: '主体模板',
    type: 'code',
    cardpos: 6
  }, {
    code: 'resource_id',
    name: '资源数据集',
    type: 'ref',
    cardpos: 7,
    rangeset: {
      path: '/service/{app}/bill/data/dataset/list'
    }
  }, {
    code: 'resource_tpl',
    name: '资源模板',
    type: 'code',
    cardpos: 8
  }, {
    code: 'memo',
    name: '备注',
    type: 'memo',
    cardpos: 10
  }]
}
export default {
  getModel(act) {
    if (act.type === 'edit') {
      if (act.actionData.type) {
        return act.$owner.model
      } else {
        return model
      }
    } else {
      return model
    }
  }
}
